//package leetcode;
//
//import java.util.Stack;
//
//class Solution {
//    public boolean validataStackSequences(int[] pushed, int[] poped) {
//        Stack<Integer> stack = new Stack<>();
//        int i = 0;
//        for (int num : pushed) {
//            stack.push(num);
//            while (!stack.isEmpty() && stack.peek() == poped[i]) {
//                stack.pop();
//                i++;
//            }
//        }
//        return stack.isEmpty();
//    }
//}
//
//public class Test3 {
//    public static void main(String[] args) {
//        int[] pushed = {1,2,3,4,5};
//        int[] poped = {4,5,1,2,3};
//        Solution solution = new Solution();
//        boolean ret = solution.validataStackSequences(pushed,poped);
//        System.out.println(ret);
//    }
//}
